import 'package:api/pages/provider/provider/model/home_item_model.dart';
import 'package:flutter/material.dart';

class HomeCardModel with ChangeNotifier {
  List<ListItemBeam> _list = [];
  void addCardList(ListItemBeam itemBean) async {
    _list.add(itemBean);
    notifyListeners();
  }

  void removeCardList(ListItemBeam itemBean) {
    List<ListItemBeam> themList = [];
    _list.forEach((element) {
      if (element.id != itemBean.id) {
        themList.add(element);
      }
    });
    _list = themList;
    notifyListeners();
  }

  // 获取数据的方法
  List<ListItemBeam> get cardList => _list;
}
